<template>
	<view>
		<u-popup :show="popupShow" mode="center" :round="10"  @close="close" @open="open">
			
			<view class="popup-box">
				
				<view class="popup-title">
					{{title}}
				</view>
				
				<view class="popup-title" v-if="content" v-html="content"></view>
				<slot></slot>
				<view class="popup-bottom flex-no-horizontal">
					
					<view class="popup-bottom-left flex-no-horizontal" @click="close">
						{{cancel}}
					</view>
					
					<view class="popup-bottom-right flex-no-horizontal" @click="$emit('reserved')">
						{{ensure}}
					</view>
					
				</view>
				
			</view>
			
		</u-popup>
	</view>
</template>

<script>
	export default {
		props:{
			//弹框title
			title:{
				type:String,
				default:''
			},
			content:{
				type:String,
		        default:''
			},
			// 取消按钮
			cancel:{
				type:String	,
				default:"取消"
			},
			//确定按钮
			ensure:{
				type:String	,
				default:"确定"
			}
		},
		data() {
			return {
				popupShow:false
			}
		},
		methods: {
			//取消弹框
			close(){
				this.popupShow = false
			},
			open(){
				this.popupShow = true
			}
		}
	}
</script>

<style lang="scss" scoped>
.popup-box{
		padding: 68rpx 40rpx 60rpx 40rpx;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		.popup-title{
			text-align: center;
			color: $uni-color-black;
			font-size: $uni-font-size-lg;
			margin-bottom: 60rpx;
		}
		
		.popup-bottom{
			justify-content: space-between;
			
			.popup-bottom-left{
				justify-content: center;
				width: 235rpx;
				height: 80rpx;
				border-radius: 40rpx;
				background-color: rgba(247, 247, 247, 1);
				color: rgba(178, 180, 181, 1);
				font-size: $uni-font-size-base;
				margin-right: 40rpx;
			}
			
			.popup-bottom-right{
				justify-content: center;
				width: 235rpx;
				height: 80rpx;
				border-radius: 40rpx;
				background-color: rgba(55, 214, 123, 1);
				color: #FFFFFF;
				font-size: $uni-font-size-base;
			}
			
		}
		
	}
</style>
